I want to develop an office add in to add image effect to user selected image. but i did not find how to get the image content in the reference.
I have tried getSelectedDataAsync api, but it not work.
Office.context.document.getSelectedDataAsync(Office.CoercionType.Image, function(asyncResult) {
console.log(asyncResult)
});
Console output:
OSF.DDA.AsyncResult {value: undefined, status: 'failed', error: OSF.DDA.Error}
I also tried presentation.getSelectedShapes api, but it not work either. getSelectedShapes can get the selected shape and i can get the shape type and make sure the shape is an image, but there is no method to get the image content.
PowerPoint.run(function(context) { o = context.presentation.getSelectedShapes().getItemAt(0); o.load(); console.log(o); return context.sync() })
So is there a way to get the image content in office add-in?